<?php
/**
 * 友情链接管理模块
 * 
 + ----------------------------------------------------- 
 * Date 2013-3-8
 + -----------------------------------------------------
 */
class FriendLinkAction extends CommonAction {
	
	/**
	 * 添加
	 * @see CommonAction::add()
	 */
	public function add() {
		$model = D('FriendLink');
		//打开方式
        $this->assign('target',$model->getTarget());
		$this->display();
	}
	
	/**
	 * 编辑 
	 * @see CommonAction::edit()
	 */
	public function edit() {
        $model = D('FriendLink');
        //打开方式
        $this->assign('target',$model->getTarget());
        //当前数据
        $id = $_REQUEST[$model->getPk()];
        $data = $model->find($id);
        $this->assign('data', $data);
        $this->display('add');
    }
    
    /**
     * 列表
     * @see CommonAction::index()
     */
    public function index() {
    	//列表过滤器，生成查询Map对象
    	$map = $this->_search();
    	if (method_exists($this, '_filter')) {
    		$this->_filter($map);
    	}
    	$model = D('FriendLink');
    	if (!empty($model)) {
    		$this->_list($model, $map , 'sort_order' , true);
    	}
    	$this->display();
    	return;
    }
	
}

?>